<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<head />

<ui:composition template="_template.xhtml">

	<ui:define name="conteudo">

		<p:panel header="Adicionar Cadastro de Cliente">

			<h:form>

				<h:panelGrid columns="2">

					<p:outputLabel value="Nome" for="nome" />
					<p:inputText id="nome" size="40" value="#{clienteBean.cliente.nome}"/>

					<p:outputLabel value="Telefone" for="telefone" />
					<p:inputMask  id="telefone" value="#{clienteBean.cliente.telefone}" mask="(99) 9999-9999"/>

					<p:outputLabel value="Celular" for="celular" />
					<p:inputMask  id="celular" value="#{clienteBean.cliente.celular}" mask="(99) 999-999-999"/>

					<p:outputLabel value="E-mail" for="email"/>
					<p:inputMask  id="email" size="40" value="#{clienteBean.cliente.email}"/>
					
				</h:panelGrid>

				<h:panelGrid columns="2">
					<p:outputLabel for="nascimento" value="Nascimento" />
					<p:calendar id="nascimento" value="#{clienteBean.cliente.dtNasc}" 
					locale="de" navigator="true" pattern="dd-MM-yyyy"/>
				</h:panelGrid>

				<h:panelGrid columns="2" style="margin-bottom:10px" cellpadding="5">
					<p:outputLabel for="genero" value="Gênero:" />
					<p:selectOneRadio id="genero" value="#{clienteBean.cliente.sexo}">
						<f:selectItem itemLabel="Feminino" itemValue="F" />
						<f:selectItem itemLabel="Masculino" itemValue="M" />
					</p:selectOneRadio>
				</h:panelGrid>

				<h:panelGrid columns="3">
					<p:commandButton value="Inserir" actionListener="#{clienteBean.adicionarCliente}"/>
					<p:commandButton value="Limpar" type="reset"/>
					<p:messages id="messages" showDetail="true" autoUpdate="true" closable="true" />
				</h:panelGrid>
			</h:form>
		</p:panel>
	</ui:define>
</ui:composition>
</html>